<template>
  <div class="aui-page__fr" style="hight:400px">
    正在准备帆软环境...
  </div>
</template>

<script>
export default {
  data () {
    return {
    }
  },
  computed: {
  },
  created () {
  },
  mounted () {
    this.init()
  },
  methods: {
    init () {
      let token = this.getUrlKey('uniedp_token') || this.$cookies.get('token')
      let frId = this.getUrlKey('frId') || this.$route.params.frId
      let loginUrl = this.getUrlKey('loginUrl') || window.SITE_CONFIG['siteUrl']
      let frUrl = `${window.SITE_CONFIG['frUrl']}/webroot/decision/view/report?viewlet=${frId}&uniedp_token=${token}`
      console.log('fr - ', token, frId)
      if (frId && token) {
        this.jump(frUrl)
      } else {
        this.jump(loginUrl)
      }
    },
    jump (url) {
      window.location.href = url
    },
    getUrlKey (name) {
      return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || ['', ''])[1].replace(/\+/g, '%20')) || null
    }
  }
}
</script>

<style>
.aui-page__fr {
  margin: 30px;
}
</style>
